Memory systems with non-volatile memories (such as flash memory) typically perform garbage collection on a group of memory blocks that are partially filled with valid data in order to store the valid data in a smaller group of blocks, thereby creating one or more empty blocks for storing new data. In general, the blocks that are targeted for garbage collection are typically those with the least amount of valid data to copy (i.e., the blocks with the lowest “valid count”). Valid data from the blocks with the lowest valid counts are copied to the same target block.
Some memory systems implement data identification methods in order to avoid mixing different data types (e.g., random data and sequential data) in the same block when that data is written to the memory, as such mixing may cause the garbage collection process to be inefficient. Random data is data that is likely to change shortly after it has been written to the memory, while sequential data is data that is likely to remain unchanged for a long period of time. Common methods for data identification are applied to “fresh” data that is written to the memory. At this stage, a number of blocks are open for writing according to the data type. For example, one open block may be dedicated to data of type “stream,” while another block may be dedicated to random data written in small chunks, and yet a third block may be dedicated to random data written at a page resolution.
In a block containing both random and sequential data, the random data will become obsolete while the sequential data may still be valid. Such a block may, therefore, suffer from frequent garbage collection operations (like a hot block), with a large amount of data to be copied to a new block (like a cold block). In contrast, a block containing only sequential data will most probably stay stable, and garbage collection operations may be applied to such a block at a lower rate than the rate of garbage collection on a random block. Accordingly, avoiding mixing different data types when the data is initially written to memory can reduce system complexity and simplify the garbage collection process.